package com.fatgirl.load
{
	import com.fatgirl.utils.binding.MetaData;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	
	public class LoadData extends MetaData
	{
		public static const LOAD_COMPLETE:int = 1;
		public static const LOAD_IO_ERROR:int = 2;
		public static const LOAD_PROGRESS:int = 3;
		public static const LOAD_OPEN:int = 4;
		public static const LOAD_SELF_ERROR:int = 5;
		
		public var url:String;

		public var data:Object;
	
		public var progress:int;
		
		public var loadResultType:int;
		
		public var loadUseTime:int;
		public function LoadData()
		{
			//TODO: implement function
			super();
		}
		public function destroy():void
		{
			if(data)
			{
				if(data is Bitmap)
				{
					(data as Bitmap).bitmapData.dispose();
				}
				else if(data is BitmapData)
				{
					(data as BitmapData).dispose();
				}
				else
				{
					data = null;
				}
			}
			this.destroyAllListener();
			url = null;
		}
	}
}